package com.mspbots.cw.amqp;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.mspbots.api.client.CoreClient;
import org.springframework.amqp.rabbit.core.RabbitMessagingTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.r2dbc.core.DatabaseClient;

/**
 * com.mspbots.core.amqp.AbstractBaseReceiver
 *
 * @author Alex bob(https://github.com/vnobo)
 * @date Created by 2019/8/12
 */
public abstract class BaseReceiver {

    protected CoreClient coreClient;
    protected DatabaseClient databaseClient;
    protected ObjectMapper objectMapper;
    protected RabbitMessagingTemplate messagingTemplate;

    @Autowired
    public void setObjectMapper(ObjectMapper objectMapper) {
        this.objectMapper = objectMapper;
    }

    @Autowired
    public void setCoreClient(CoreClient coreClient) {
        this.coreClient = coreClient;
    }

    @Autowired
    public void setDatabaseClient(DatabaseClient databaseClient) {
        this.databaseClient = databaseClient;
    }

    @Autowired
    public void setMessagingTemplate(RabbitMessagingTemplate messagingTemplate) {
        this.messagingTemplate = messagingTemplate;
    }
}
